package com.qd.common.panda.domain.entity.func;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import java.time.LocalDateTime;

/**
 * 扫码记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ChannelScanLogDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "扫码记录ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "扫码记录ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String scanCodeRecordId;
    /**
     * 渠道编码
     */
    @Size(max = 10, message = "渠道编码长度不能超过{max}位", groups = DefaultGroup.class)
    private String channelCode;
    /**
     * 渠道名称
     */
    @NotBlank(message = "渠道名称不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "渠道名称长度不能超过{max}位", groups = DefaultGroup.class)
    private String channelName;
    /**
     * 联系人
     */
    @Size(max = 100, message = "联系人长度不能超过{max}位", groups = DefaultGroup.class)
    private String contact;
    /**
     * 联系电话
     */
    @Size(max = 20, message = "联系电话长度不能超过{max}位", groups = DefaultGroup.class)
    private String contactPhone;
    /**
     * 扫码用户手机号
     */
    @Size(max = 20, message = "扫码用户手机号长度不能超过{max}位", groups = DefaultGroup.class)
    private String scanUserMobile;
    /**
     * 扫码用户ID
     */
    @Size(max = 50, message = "扫码用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String scanUserId;
    /**
     * 扫码时间
     */
    private LocalDateTime scanTime;
    /**
     * IP地址
     */
    @Size(max = 20, message = "IP地址长度不能超过{max}位", groups = DefaultGroup.class)
    private String ipAddress;
    /**
     * 功能ID
     */
    @NotBlank(message = "功能ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "功能ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String funcId;
    /**
     * 小程序功能地址
     */
    @Size(max = 50, message = "小程序功能地址长度不能超过{max}位", groups = DefaultGroup.class)
    private String funcUrl;
    /**
     * 小程序功能地址显示
     */
    private String funcUrlDisplay;

    @Override
    public void freeData() {
        this.scanCodeRecordId = null;
        this.channelName = null;
        this.contact = null;
        this.contactPhone = null;
        this.scanTime = null;
        this.scanUserMobile = null;
        this.scanUserId = null;
        this.ipAddress = null;
        this.funcId = null;
        this.channelCode = null;
        this.funcUrl = null;
        super.freeData();
    }
}
